<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="<%=Config.getWebPath()%>/css/ext-all.css" />
		<script type="text/javascript"	src="<%=Config.getWebPath()%>/js/ext/ext-base.js"></script>
	    <script type="text/javascript" src="<%=Config.getWebPath()%>/js/ext/ext-all.js"></script>			
	</head>
	
<!--********************* Part2:Java Code *********************-->

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->

<script language=javascript>

<%
WarehouseProductViewSearchEvent event = (WarehouseProductViewSearchEvent)context.getSessionValue("WarehouseProductViewSearchEvent");

ObjectList warehouseList = (ObjectList)context.getSessionValue("WarehouseListDetail");

String uiListDataTR_My1 = "<tr align='center' height=\"24\"  bgcolor=\"#FFFF37\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#FFFF37\"'";
String uiListDataTR_My2 = "<tr align='center' height=\"24\"  bgcolor=\"#FFA042\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#FFA042\"'";     
String uiListDataTR_My3 = "<tr align='center' height=\"24\"  bgcolor=\"#FF5809\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#FF5809\"'";
String uiListDataTR_My4 = "<tr align='center' height=\"24\"  bgcolor=\"#800080\"   onmouseover='this.style.backgroundColor=\"#D0DBE6\"' onmouseout='this.style.backgroundColor=\"#800080\"'";
String []uiListDataTR_My = new String[]{uiListDataTR_My1, uiListDataTR_My2, uiListDataTR_My3,uiListDataTR_My4}; 

String msg = (String)session.getAttribute("MSG");
session.removeAttribute("MSG");

if(msg != null){
%>
    alert("<%=msg%>");
<%
}
%>

var list_code = "listProviderProduct2";

function process(val)
{
	var warehouseCode = $.jstree._reference("#warehouseLevel").get_checked();
	var warehouseList = new Array();
	 var i = 0;
	 $.each(warehouseCode, function() {
	           warehouseList[i] =($(this).attr("id"));
	           i++;
	 });
    SetValue("title","19");
    SetValue("WarehouseCode",warehouseList); 
    SetValue("begindate",GetValue("i_Year"));
    SetValue("enddate",GetValue("i_Month"));
    SetValue("querytype","1");
    var loadMask= new Ext.LoadMask(document.body,{
		msg : '正在处理, 请稍等...',
		removeMask : true
	});
	loadMask.show();
    frm.action = "<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportServlet2") %>";
    frm.submit();
    window.onblur = function() {
    	loadMask.hide();
    	window.onblur = null;
    };
}

</script>
<script type="text/javascript" src = "<%=Config.getWebPath()%>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src = "<%=Config.getWebPath()%>/js/jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet" href="<%=Config.getWebPath()%>/css/themes/default/style.css"/>
<script type="text/javascript">
	   $(function() {
		    $("#warehouseLevel").jstree({
		        "plugins" : [ "themes", "html_data", "checkbox", "ui" ]
		       
		    });
		    
		    var checkedWarehouseCodes = "<%=event.getWarehouseTreeCodes()[0]%>";
		    
		    if(checkedWarehouseCodes == "") checkedWarehouseCodes = "00";
		    
		    var arrayCheckedWarehouseCodes = checkedWarehouseCodes.split(",");
		   
		   		  	
		  	var checkSel = function(ary, val) {
		  		for(var i=0; i<ary.length; i++) {
		  			if(ary[i] == val) {
		  				return true;
		  			}
		  		}
		  		
		  		return false;
		  	}
	

		  
		  
		});
			
</script>

<%=uiBody%>>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="warehouseCode" value="<%=event.getWarehouseTreeCodes()[0]%>" > 

<input type='hidden' name='begindate' value="">
<input type='hidden' name='enddate' value="">
<input type='hidden' name='querytype' value="">
<input type='hidden' name='title' value="">

<!--查询条件保留区域-->


<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
    int key_tab = 1 ;
%>

<table id=listTable cellpadding='1' cellspacing='1' width='100%' class='data_line'><thead class='data_th'>

<tr align='center' height='24'>

    <td colspan = "2">应付款月报(供应商)</td></tr>

    
<tbody class='data_tb'>

    <tr height="24"  bgcolor="#EBEEF3">
        <td >
         选择仓库：    
            <div id="warehouseLevel" style="background-color: DEE4E9">
				<%=Warehouse.getWarehouseTree(warehouseList,event.getWarehouseCodes())%>
			</div>
        </td>

    </tr>

    <tr height="24"  bgcolor="#FFFFFF">

        <td` >&nbsp;选择结算月份：<%=SelectManager.viewYearSelect(con,"i_Year","2012",false,"","-请选择-","","")%>  <%=SelectManager.viewMonthSelect(con,"i_Month","01",false,"","-请选择-","","")%></td>

        <td >
            <input type="button" name="button1" class='buttons' value="生成报表" onclick='process(1)'>
        </td>
    </tr>
</tbody>

</table>


<%=uiSearchEnd%>

</form>


<%@ include file="/framework/foot.jsp"%>
